﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Security.Principal;
using System.Text;
using WooCoo.Security;

namespace WooCoo.Security
{   
    public class UserPrincipal : IPrincipal
    {
        public UserIdentity UserIdentity { get; set; }
        public UserPrincipal(UserIdentity uid)
        {
            this.UserIdentity = uid;
        }

        #region IPrincipal 成员
        [IgnoreDataMember]
        IIdentity IPrincipal.Identity
        {
            get { return UserIdentity; }
        }

        public bool IsInRole(string role)
        {
            return true;
        }

        #endregion
    }
}
